/**
 * Created by yubaolin on 2017/9/28.
 */
import ajax from '../ajax'

export default {
  getList (params, success, fail = null) {
    ajax.get({url: '/api/member_address/list', params, success, fail})
  },
  save (address, success, fail = null) {
    const method = address.id === 0 ? 'post' : 'put'
    ajax[method]({url: `/api/member_address/${address.id}`, data: address, success, fail})
  },
  delete (id, success, fail = null) {
    ajax.del({url: `/api/member_address/${id}`, success, fail})
  },
  deleteList (ids, success, fail = null) {
    ajax.del({url: `/api/member_address/deleteList`, data: {ids}, success, fail})
  }
}
